<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!-- 容器 -->
<div id="root">
    <input type="text" placeholder="按下回车键触发事件" @keyup.enter="handleEnter">
</div>
<script type="text/javascript">
new Vue({
    el: '#root',
    methods: {
        handleEnter(e){
            // if(e.keyCode !==13) return;
            console.log(e.target.value)
        }
    }
})

</script>
</body>
</html>